package com.one.pass.fegin;

import com.one.pass.config.TryRun;
import com.one.pass.controller.resp.BaseResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;
/*
PayFegin接口用于定义调用远程支付服务的Feign客户端，包含支付和批量充值完成回调接口。
使用@FeignClient注解配置Feign客户端的名称、远程服务URL和自定义配置类。
thirdPay方法用于调用支付接口，batchPayFinish方法用于调用批量充值完成回调接口，并使用自定义注解@TryRun确保其一定会被调用。
*/

//本地测试
//@FeignClient(value = "PayFegin", url = "http://120.92.116.60", configuration = PayConfirguration.class)
//云服务器测试
@FeignClient(value = "PayFegin", url = "http://172.16.0.90", configuration = PayConfirguration.class)

public interface PayFegin {

    // 调用支付接口
    @PostMapping("/thirdpart/onePass/pay")
    BaseResponse thirdPay(@RequestBody PayReq map);

    // 批量充值完成回调
    @PostMapping("/thirdpart/onePass/batchPayFinish")
    @TryRun("一定要调用")
//    BaseResponse batchPayFinish(@RequestBody Map<String, Object> map);
    BaseResponse batchPayFinish(@RequestParam Map<String, Object> map);
}
